using System;
using System.Diagnostics;
using UnityEngine;

namespace AutoChess
{
    class AvatarDefine
    {
        public static string GetDummyPointName(DummyPoint type)
        {
            string pointName = type.ToString();
            switch (type)
            {
                case DummyPoint.DM_S_ROOT:
                   pointName = "Actor_Root";
                   break;
               case DummyPoint.DM_S_BREAST:
                   pointName = "Actor_BREAST";
                   break;
               case DummyPoint.DM_S_HEAD:
                   pointName = "Actor_HEAD";
                   break;
                default:
                    break;
            }

            return pointName;
        }

        public static string GetChessRootDummyPointName(ChessDummyPoint type)
        {
            string pointName = String.Empty;
            switch (type)
            {
                case ChessDummyPoint.DM_ACROOT:
                     pointName = "AC_ROOT";
                     break;
                 case ChessDummyPoint.DM_ACHERO:
                     pointName = "AC_Hero";
                     break;
                 case ChessDummyPoint.DM_ACGRID:
                     pointName = "AC_Grid";
                     break;
                 case ChessDummyPoint.DM_ACSHIP:
                     pointName = "AC_Ship";
                     break;
                 case ChessDummyPoint.DM_EffectRoot:
                     pointName = "AC_Effect";
                     break;
                default:
                    break;
            }

            return pointName;
        }
        
        public static GameObject CreateDummyPoint(string dummyName,Transform rootTrans,Vector3 localPos)
        {
            if(string.IsNullOrEmpty(dummyName))
                return null;
            
            GameObject dummyGo = new GameObject(dummyName);
            dummyGo.transform.parent = rootTrans;
            dummyGo.transform.localRotation = Quaternion.identity;
            dummyGo.transform.localPosition = localPos;
            return dummyGo;
        }
    }
}